<include file="__THEME__/public_header" />

<div id="page-wrap">
    <div id="main-wrap">
    	<div id="st-index-grid" class="st-grid">
            <div id="col8" class="st-section boxShadow content-bg">
            	<include file="__THEME__/public_right" />
                <div id="col5" class="st-index-main">
	                <div class="extend-foot">
	                    <div class="feed-nav clearfix">
	                    	<div class="my-feed-title">
	                    		<span class="right">
                                    <!-- <form action="{:U('public/Index/follower')}" method="post" id="searchfeed"> -->
                                    <div class="feed-search">
                                    <input class="s-txt left"  type="text" name='follow_key' value="{$follow_key}" id='follow_key'>
                                    <a href="javascript:;" class="ico-search left" onclick="doSearchKey()"></a>
                                    </div>
                                    <!-- </form> -->
                                </span>
	                    		<h4 class="left">我的粉丝(共<span id="follow_count" event-node="follower_count" event-args="uid={$GLOBALS['ts']['mid']}">{$followerCount|default=0}</span>人)</h4>
	                    	</div>
		                </div>
						<div class="sperson-feedlist">
						<php>if($data){</php>
							<volist name="data" id="vo">
								<dl class="feed_list" id="follower_{$vo['uid']}">
									<dt class="face">
										<a href="{$vo.space_url}" title="{$vo.uname}"><img src="{$vo.avatar_small}" /></a>
									</dt>
									<dd class="person-info">
										<div class="info-right right">
											<p>{:W('FollowBtn', array('fid'=>$vo['uid'], 'uname'=>$vo['uname'], 'follow_state'=>$vo['followState']))}</p>
											<p><a rel="add" onclick="core.plugInit('blacklist',this,'btn',{$vo['uid']},'')" href="javascript:void(0)">加入黑名单</a></p>
										</div>
									   <div class="info-left">
										<p class="hd">
											<a class="follow_uname" href="{$vo['space_url']}" event-node='face_card' uid="{$vo['uid']}" style="font-size:14px">{$vo.uname}</a>
											<volist name="userGroupData[$vo['uid']]" id="v1">
                                			<img style="width:auto;height:auto;display:inline;cursor:pointer;vertical-align:-3px" src="{$v1['user_group_icon_url']}" title="{$v1['user_group_name']}" />&nbsp;
                              			    </volist>
										</p>
										<p class="area"><span><if condition="$vo.sex eq 1"><i class="ico-male"></i><else /><i class="ico-female"></i></if>&nbsp;{$vo.location}</span>
										</p>
										<p class="action">											
											{:L('PUBLIC_FOLLOWING')}：<a href="{:U('public/Profile/following', array('uid'=>$vo['uid']))}">{$vo.following_count|default=0}</a>
											<i class="vline">|</i>
											{:L('PUBLIC_FOLLOWERS')}：<a href="{:U('public/Profile/follower', array('uid'=>$vo['uid']))}">{$vo.follower_count|default=0}</a>
											<i class="vline">|</i>
											{:L('PUBLIC_WEIBO')}：<a href="{:U('public/Profile/index', array('uid'=>$vo['uid']))}">{$vo.feed_count|default=0}</a>
										</p>
										<php>if($vo['intro']){</php>
										<p class="info">
											{:L('PUBLIC_PROFILESET_INTRO')}：{$vo.intro}
										</p>
										<php>}</php>
										<php>if($user_tag[$vo['uid']]){</php>
										<p class="info">
											{:L('PUBLIC_TAG')}：<volist name="user_tag[$vo['uid']]" id="u_t_v"><a href="{:U('public/Search/index',array('t'=>3,'a'=>'public','k'=>$u_t_v))}">{$u_t_v}</a>&nbsp;&nbsp;&nbsp;</volist>
										</p>
										<php>}</php>
									   </div>	
									</dd>
								</dl>
							</volist>
							<div id="page" class="page">{$html}</div>
						<php>}elseif($follow_key !== '' && !is_null($follow_key)){</php>
						<div class="loading">抱歉，暂时没有找到与 “{$follow_key}” 相关的结果</div>
						<php>}else{</php>
                        <div class="loading">暂时没有关注你的人</div>
                    <php>}</php>
						</div>
	                </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
/**
 * 高亮Js
 * @param  {[type]} a [description]
 * @param  {[type]} b [description]
 * @return {[type]}   [description]
 */
var doHighlight = function (a, b) {
    highlightStartTag = "<span style='color:red;font-size:14px'>";
    highlightEndTag = "</span>";
    var c = "";
    var i = -1;
    var d = b.toLowerCase();
    var e = a.toLowerCase();
    while (a.length > 0) {
        i = e.indexOf(d, i + 1);
        if (i < 0) {
            c += a;
            a = "";
        } else {
            if (a.lastIndexOf(">", i) >= a.lastIndexOf("<", i)) {
                if(e.lastIndexOf("/script>",i)>=e.lastIndexOf("<script",i)){
                    c+=a.substring(0,i)+highlightStartTag+a.substr(i,b.length)+highlightEndTag;
                    a=a.substr(i+b.length);e=a.toLowerCase();
                    i=-1;
                }
            }
        }
    }
    return c;
};
/**
 * 添加Jquery方法
 * @param  {[type]} z [description]
 * @return {[type]}   [description]
 */
$.fn.highlight=function(z){
    $(this).each(
        function(){
            $(this).html(doHighlight($(this).html(),z))
        });
    return this;
}
/**
 * 绑定高亮
 * @return {[type]} [description]
 */
$(document).ready(function(){
	var key3 = $.parseJSON('{$jsonKey}');
	$('.follow_uname').highlight(key3);
}); 

var doSearchKey = function () {
	location.href = U('public/Index/follower') + '&follow_key=' + $.trim($('#follow_key').val());
	return false;
};
</script>


<script type="text/javascript" src="__THEME__/js/module.weibo.js"></script>
<include file="__THEME__/public_footer" />